<?php

class Experience
{
	
	function get_experience_select()
	{
		$conn = mysql_connect(DB_HOSTNAME, DB_USERNAME, DB_PASSWORD) or die('An error has occured: Could not connect to the MySQL database.');
		mysql_select_db(DB_NAME) or die("An error has occured:  Could not connect to the table.");
		
		$sql = "select experienceid, name from wms_experience order by name;";	
			
		$result = mysql_query($sql);
		if(!$result) die("An error has occured: " . mysql_error());
		
		mysql_close($conn);	
		
		while($row = mysql_fetch_assoc($result))
		{
			$id = $row['experienceid'];
			$name = $row['name'];
			
			$experience[$id] = $name;
		}
		
		return $experience;
	}	
	
}

?>